package wechat.resources;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import wechat.resources.app.app53;

public class AppFilter {

	private static Logger log = LoggerFactory.getLogger(AppFilter.class);

	private static app53 app53;
	private static String app53_APPID;
	private static String app53_CORPID;

	static {
		app53 = new app53();
		app53_APPID = app53.getAppid();
		app53_CORPID = app53.getCorpid();
	}

	public AppFilter() {

	}

	public static InstanceResource chooseApp(String appid) {
		log.info("AppFilter --- chooseApp appid=" + appid);
		if (app53_APPID.contains(appid)) {
			return app53;
		}
		return null;
	}

	public static String getAppId(String str) {
		log.info("AppFilter --- getAppId appid=" + str);
		if (str.contains(app53_APPID)) {
			return app53_APPID;
		}

		return null;
	}

	public static String getCorId(String str) {
		log.info("AppFilter --- getAppId corID=" + str);
		if (str.contains(app53_APPID)) {
			return app53_CORPID;
		}

		return null;
	}
}
